#ifndef OPENGLWINDOWH_INCLUDED
#define OPENGLWINDOWH_INCLUDED

#define DEFAULT_WINDOW_WIDTH	640
#define DEFAULT_WINDOW_HEIGHT	480



#include "main.h"

//LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg,WPARAM wParam, LPARAM lParam);


class OpenglWindow {
private:
	// Vars
	HWND		hWnd;
	HDC			hDC;
	HGLRC		hRC;
	HINSTANCE	hInstance;

	int			width, height;


	bool		ready;

	// Functions
	void		init(char *title, int w, int h, LRESULT (* callback) (HWND , UINT ,WPARAM , LPARAM ) );
	bool		initGL();

public:
	// Constructors
	OpenglWindow(LRESULT (* func) (HWND , UINT ,WPARAM , LPARAM ));
	OpenglWindow(char *title, LRESULT (* func) (HWND , UINT ,WPARAM , LPARAM ));
	OpenglWindow(char *x, int y, LRESULT (* func) (HWND , UINT ,WPARAM , LPARAM ));
	OpenglWindow(char *title, int w, int h, LRESULT (* func) (HWND , UINT ,WPARAM , LPARAM ));

	// Deconstructor
	~OpenglWindow();

	// Functions
	void		show();
	void		swapBuffers();
	void		destroy();
	void		resize(int w, int h);




};

// errorclass
class OpenglWindowException
{
private:
	
public:
	OpenglWindowException() : message("OpenglWindowException") { }
	OpenglWindowException(char *error) : message(error) { }
	const char *message;

};

#endif



